package com.example.hxds.cst.service.impl;

import com.codingapi.txlcn.tc.annotation.LcnTransaction;
import com.example.hxds.cst.db.dao.CustomerCarDao;
import com.example.hxds.cst.db.pojo.CustomerCarEntity;
import com.example.hxds.cst.service.CustomerCarService;
import com.example.hxds.cst.service.CustomerService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.HashMap;

/**
 * @Author XUYANG
 * @Date 2024-03-16 18:34
 */
@Service
public class CustomerCarSerxiceImpl implements CustomerCarService {
    @Resource
    private CustomerCarDao customerCarDao;
    @Override
    @Transactional
    @LcnTransaction
    public void insert(CustomerCarEntity entity) {
        customerCarDao.insert(entity);
    }

    @Override
    public ArrayList<HashMap> searchCustomerCarList(long customerId) {
        ArrayList list=customerCarDao.searchCustomerCarList(customerId);
        return list;
    }

    @Override
    @Transactional
    @LcnTransaction
    public int deleteCustomerCarById(long id) {
        int rows=customerCarDao.deleteCustomerCarById(id);
        return rows;
    }
}
